<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;

class RequestLaborFilter
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse)  $next
     * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
     */
    public function handle(Request $request, Closure $next)
    {
        // $companyId =  $request->header('companyId');
        if(empty($companyId)){
            // return response()->json(['code' => 401, 'message' => '参数错误,请重新操作','data'=>null]);
        }
        $request->merge([
            // 'company_id' => $companyId,
        ]);
        return $next($request);
    }
}
